package com.general.framework.core.exception;

/**
 * @author leejean
 * @date 2020年07月02 10:31:16
 */
public enum CodeEnum implements ICode {
    SUCCESS(200, "操作成功"),
    VIOLATION_ERROR(100, "参数错误"),
    TRY_AGAIN_LATER(101, "系统繁忙，请稍后再试"),
    FILE_PROCESSING_ERROR(102, "文件处理异常"),
    ILLEGALITY_OPERATION(103, "非法操作"),
    BUSINESS_ERROR(400, "业务异常"),
    UNAUTHORIZED(401, "登录已过期或未登录"),
    FORBIDDEN(403, "拒绝访问"),
    NOT_FOUND(404, "资源不存在"),
    BAD_METHOD(405, "不允许的请求方式"),
    DATA_DENIED_ACCESS(406, "拒绝访问的数据"),
    SYSTEM_ERROR(500, "系统错误"),
    RPC_ERROR(502, "微服务调用异常"),
    RPC_CIRCUIT_BREAK(503, "服务熔断");

    private Integer code;

    private String message;

    CodeEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }


    @Override
    public Integer getCode() {
        return this.code;
    }

    @Override
    public String getMessage() {
        return this.message;
    }
}

